<template>
  <el-select v-model="val" placeholder="请选择" @change="change">
    <el-option
      v-for="item in dictList"
      :key="item.val"
      :label="item.name"
      :value="item.val"
    />
  </el-select>
</template>

<script>
import { noteTypeList } from '@/api/config/dict'
export default {
  name: 'MblDictSelect',
  props: {
    value: String,
    code: {
      require: true,
      type: String
    }
  },
  data() {
    return {
      dictList: undefined,
      val: undefined
    }
  },
  mounted() {
    noteTypeList(this.code).then(res => {
      this.dictList = res.data.data
    })
    this.val = this.value
  },
  methods: {
    change(val) {
      this.$emit('input', val)
    }
  }
}
</script>

<style scoped>

</style>
